package com.suke.czx.modules.incentivegrant.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.suke.czx.common.validate.IncentiveGrantGroup;
import com.suke.czx.common.validate.IncentiveGrantUpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 应用模块名称: 绩效发放
 * 代码描述: 绩效发放实体
 * copyright: AUZAR ALL RIGHTS RESERVED
 * company: AUZAR
 *
 * @author: 颜米晨
 * @date: 2022/07/22 0:50
 */
@Data
@ApiModel(value = "绩效发放实体")
public class IncentiveGrant implements Serializable {

    private static final long serialVersionUID = 3025361647455648103L;

    @ApiModelProperty(value = "绩效发放id")
    @TableId(value = "incentive_grant_id", type = IdType.AUTO)
    @NotNull(groups = {IncentiveGrantUpdateGroup.class}, message = "绩效发放id不能为空")
    private Long incentiveGrantId;

    @ApiModelProperty(value = "项目id")
    private Long projectId;

    @ApiModelProperty(value = "项目名称")
    private String projectName;

    @ApiModelProperty(value = "组别")
    @NotNull(groups = {IncentiveGrantGroup.class}, message = "组别不能为空")
    private Integer job2;

    @ApiModelProperty(value = "绩效参数id")
    @NotNull(groups = {IncentiveGrantGroup.class}, message = "绩效参数id不能为空")
    private Long performanceConfigId;

    @ApiModelProperty(value = "员工id")
    @NotNull(groups = {IncentiveGrantGroup.class}, message = "员工id不能为空")
    private Long userId;

    @ApiModelProperty(value = "员工姓名")
    private String name;

    @ApiModelProperty(value = "金额")
    @NotNull(groups = {IncentiveGrantGroup.class, IncentiveGrantUpdateGroup.class}, message = "发放金额不能为空")
    @Min(value = 0, message = "发放金额不能为0")
    private BigDecimal amount;

    @ApiModelProperty(value = "发放时间")
    private Date grantTime;

    @ApiModelProperty(value = "备注")
    private String note;

    @ApiModelProperty(value = "删除标记 0：删除 1：正常")
    private Integer del;

    @ApiModelProperty(value = "创建者id")
    private Long creator;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新者id")
    private Long updater;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "子数据")
    private List<IncentiveGrant> children;

}